package com.zhenzhen.xszhcp.serviceImpl;

import com.zhenzhen.xszhcp.mapper.ActivityMapper;
import com.zhenzhen.xszhcp.model.Activity;
import com.zhenzhen.xszhcp.service.ActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public class ActicityServiceImpl implements ActivityService {
    @Autowired
    private ActivityMapper mapper;
    @Override
    public List<Activity> getActivityList(Map paramMap) {
        return mapper.getActivityList(paramMap);
    }

    @Override
    public List<Activity> getActivityByStudent(int sid) {
        return mapper.getActivityByStudent(sid);
    }

    @Override
    public Activity getActivityById(int id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public int insertActivity(Activity activity) {
        return mapper.insertSelective(activity);
    }

    @Override
    public int delActivity(int id) {
        return mapper.deleteByPrimaryKey(id);
    }

    @Override
    public int upActivity(Activity activity) {
        return mapper.updateByPrimaryKeySelective(activity);
    }

    @Override
    public int delActivitybyStudent(int id) {
        return mapper.delActivitybyStudent(id);
    }
}
